<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="java.util.*,com.jspsmart.upload.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<jsp:useBean id="conf" class="confInfo.ConfBean" scope= "session"></jsp:useBean>
<%	
	//conf.setPath(request.getRealPath("/"));

	SmartUpload su = new SmartUpload();
	su.initialize(pageContext);
	//su.setDeniedFilesList("exe,bat,jsp,htm,html,,");
	su.upload();
	int count = su.save(request.getRealPath("/"));
	out.println("save in" + request.getRealPath("/"));
	out.println(count + "files upload sucess!<br>");
	out.println("TEST=" + su.getRequest().getParameter("TEST")
			+ "<BR><BR>");
	for (int i = 0; i < su.getFiles().getCount(); i++) {
		com.jspsmart.upload.File file = su.getFiles().getFile(i);
		if (file.isMissing())
			continue;
		//file.saveAs("/upload/" + myFile.getFileName());
		//file.saveAs("/upload/" + myFile.getFileName(),su.SAVE_VIRTUAL);
		//file.saveAs("c:\\temp\\" + myFile.getFileName(),su.SAVE_PHYSICAL);
		out.println("<TABLE BORDER=1>");
		out.println("<TR><TD>FieldName</TD><TD>" + file.getFieldName()
				+ "</TD></TR>");
		out.println("<TR><TD>Size</TD><TD>" + file.getSize()
				+ "</TD></TR>");
		out.println("<TR><TD>FileName</TD><TD>" + file.getFileName()
				+ "</TD></TR>");
		out.println("<TR><TD>FileExt</TD><TD>" + file.getFileExt()
				+ "</TD></TR>");
		out.println("<TR><TD>FilePathName</TD><TD>"
				+ file.getFilePathName() + "</TD></TR>");
		out.println("</TABLE><BR>");
		System.out.println(file.getFileName());
		conf.parseXml(request.getRealPath("/")+file.getFileName());
	}
%>
<jsp:forward page="webscrapy.jsp"></jsp:forward>
</body>
</html>